<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <script src="js/alert.js"></script>
    <title>积分明细</title>
    <style type="text/css">
      /*  table thead tr td {
            font-size: 16px;
            color: #545454;
            text-align: center;
        }
        table tbody tr td {
            font-size: 16px;
            color: #545454;
            text-align: center;
            padding-top: 5px;
        }*/
        #data{
            padding: 0 5% 0 5%;

        }
        .bean{
            border-bottom: 1px solid #d4d4d4;
            height: 4.8em;
            padding-top: 1em;
        }

    </style>

</head>

<body>
<div id="data">

    <!--<div class="bean">
    <div style="padding-bottom: 2.5em;">
        <div style="text-align: left;float: left;width: 70%;font-size: 1.2em;">门店名奥德赛</div>
        <div style="text-align: right;float: left;width: 30%;font-size: 1.2em;">232.0</div>
    </div>
    <div>
        <div style="text-align: left;width: 30%;float: left;color: #979797;font-size: 0.9em;">消费</div>
        <div style="text-align: right;width: 70%;float: left;color: #979797;font-size: 0.9em;">20190203 12:12:12</div>
    </div>
</div>-->


</div>


<!--<table style=" width:100%;">
    <colgroup>
        <col width=20>
        <col width=40>
        <col width=20>
    </colgroup>
    <thead>
    <tr>
        <td id='BILLDATE'>单据日期</td>
        <td ID='DOCNO'>单据编号</td>
        <td ID='VIP_PAYAMT'>积分</td>
    </tr>
    </thead>
    <tbody id="data">

    </tbody>
</table>-->
</body>
<script src="js/jquery.min.js"></script>
<script type="">
    $(document).ready(function () {
       getdata()
    });

    function getdata(){
        $.ajax({
            "url": "/vip/recharge/",
            "type": "POST",
            "dataType": "json",
            "success": function (json) {
                $("#data").empty();
                var list = json.data;

                for (var i = 0; i < list.length; i++) {
                    if ("0" !== list[i].integral) {
                        var html = '<div class="bean">'+
                            '<div style="padding-bottom: 2.5em;">'+
                            '<div style="text-align: left;float: left;width: 70%;font-size: 1.2em;">#{DOCNO}</div>'+
                            '<div style="text-align: right;float: left;width: 30%;font-size: 1.2em;color: #{COLOR}">#{VIP_PAYAMT}</div>'+
                            '</div>'+
                            '<div>'+
                            '<div style="text-align: left;width: 30%;float: left;color: #979797;font-size: 0.9em;">#{TYPE}</div>'+
                            '<div style="text-align: right;width: 70%;float: left;color: #979797;font-size: 0.9em;">#{BILLDATE}</div>'+
                            '</div>'+
                            '</div>';

                        html = html.replace("#{BILLDATE}", list[i].date);
                        html = html.replace("#{DOCNO}", list[i].code);
                        html = html.replace("#{VIP_PAYAMT}", list[i].integral.replace("-",""));
                        html = html.replace("#{TYPE}",Number(list[i].integral)>0?"充值":"消费");
                        html = html.replace("#{COLOR}",Number(list[i].integral)>0?"green":"red");
                        $("#data").append(html);
                    }
                }
            }
        })
    }

</script>
</html>